package jym.tan.movielibrary.component.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import jym.tan.movielibrary.component.ui.button.MovieTitleConfirmButton;
import jym.tan.movielibrary.component.ui.textfield.MovieTitleTextField;
import jym.tan.movielibrary.factory.ComponentFactory;
import jym.tan.movielibrary.logger.LibraryLogger;

import org.apache.commons.lang.StringUtils;

public class MovieTitleConfirmTextTimerListener implements ActionListener {

	public void actionPerformed(ActionEvent actionEvent) {
		LibraryLogger.runningTimerMessage(actionEvent.getSource().getClass().getSimpleName());
		MovieTitleConfirmButton button = ComponentFactory.getMovieTitleConfirmButton();
		MovieTitleTextField textField = ComponentFactory.getMovieTitleTextField();		
		button.setEnabled(StringUtils.isNotBlank(textField.getText()));		
	}
}
